home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 031a / xctl12.zip / X10CTL.TXT < prev   
Text File  |  1991-11-12  |  12KB  |  274 lines

  1. X-10 Control Program for Windows (X10CTL)  Ver. 1.2
  2.  
  3.  
  4. NOTICE
  5.  
  6. This program is available at no cost from the Author, Larry E.
  7. Fosdick [CIS 70105,1142].  No warranty, either expressed or
  8. implied, covers losses of data, fingernails, or hair from the
  9. use or abuse of this software.  This program may be freely
  10. distributed.  No money is to be collected for this software,
  11. especially by the author, who did this for recreation.
  12. The source code is NOT available.
  13.  
  14.  
  15. INTRODUCTION
  16.  
  17. This program, written in Microsoft Visual BASIC, provides
  18. complete access and control for the X-10 Powerhouse Interface
  19. (X-10 USA Inc.).  Features include:
  20.  
  21.    - True multiple window application
  22.    - X-10 clock can be automatically synchronized to computer
  23.      system clock
  24.    - Console window for immediate control
  25.    - Descriptive unit definitions entered by user
  26.    - Timed events are easily added, deleted, or modified, with
  27.      changes downloaded    automatically to the interface
  28.    - Timed event sets can be saved to and restored from disk files
  29.    - Timed events can be set to 
  30.       Today, Tomorrow, Everyday, Weekdays, Weekends, or Specific Days
  31.    - Event list can be printed for reference
  32.    - 16-position dimmer function for lamp units or light switches
  33.  
  34. X10CTL requires VBRUN100.DLL for operation, available on
  35. CompuServe.  X10CTL also requires the X-10 Powerhouse interface
  36. from X-10 (USA), Model CP290.  It can be purchased from
  37.  
  38. DAK Industries Incorporated        Heath Company
  39. 8200 Remmet Ave.            P.O. Box 8589
  40. Canoga Park, CA  91304            Benton Harbor, MI 49023-8589
  41. 800-325-0800 (Orders)            800-253-0570
  42. 800-888-9818 (Tech Info)        Heath Item BC-290-P
  43. DAK Item No.  5851
  44.  
  45. You may wish to ensure that the hardware model CP290 is still the one
  46. being sold.  There is no telling what changes could have been made if the
  47. hardware model number has changed.
  48.  
  49. I do not endorse any equipment vendor.  This information is provided
  50. to answer queries Revision 1.00 generated.  There may be other vendors,
  51. but these are the only ones known to me.  I bought my X-10 Powerhouse
  52. from DAK about three years ago, and it works very well.
  53.  
  54.  
  55. PROGRAM OPERATION
  56.  
  57. The first time the program is started, X10CTL.INI is created in
  58. your Windows directory.  This file maintains initialization
  59. parameters for X10CTL, including the COM port number, window
  60. positions, and unit descriptions.  You will be required to enter
  61. the COM port for the X-10 Interface the first time the program
  62. is run.  If you change the port in the future, you will have to
  63. edit X10CTL.INI, since the program will not operate without the
  64. Interface active.
  65.  
  66.  
  67. Main Window
  68.  
  69. The Main window provides access to the other windows in the
  70. application.  Access can be gained by double-clicking the
  71. appropriate icon, or through the menu system.  The Unit, Event,
  72. and Console windows can be open concurrently, with free movement
  73. between these windows.
  74.  
  75.  
  76. Unit Window
  77.  
  78. This window allows the user to describe up to 256 units (A1 -
  79. P16).  The descriptions are stored in X10CTL.INI in the format
  80.  
  81.         HUU=Description String
  82.  
  83. where H is the House Code (A-P) and UU is the unit number
  84. (01-16).  The leading zero is required.  Unit descriptions are
  85. added by first selecting House and Unit codes, then clicking the
  86. Add/Edit button.  A dialog box is opened, allowing the user to
  87. enter a series of characters describing the function of the
  88. unit.  Changes are saved when the application is terminated.
  89.  
  90. Unit descriptions can be edited by first selecting the unit to
  91. be edited, either using the House and Unit buttons, or by
  92. clicking the entry directly on the list, followed by clicking
  93. the Add/Edit button. 
  94.  
  95. Unit descriptions can be deleted by selecting the unit of
  96. interest, followed by clicking the Delete button.
  97.  
  98. In Version 1.2 and later, unit number 17 (which does not exist
  99. physically) is predefined as "All Lights On/Units Off".  This
  100. function was added at the request of users, who wished to be able
  101. to program "All Off" functions as events.  Note that any "On" events
  102. are translated automatically to "Dim00" (Highest lamp unit output)
  103. so that "On" functions will only work on lights connected to lamp
  104. or wall switch modules.  The "Off" functions will work with all
  105. units assigned to the given House Code.
  106.  
  107. Event Window
  108.  
  109. When the Event window is first opened, the events stored in the
  110. X-10 Interface are uploaded to the computer, then displayed. 
  111. Events can be added, updated (modified), or deleted.  All
  112. changes to the event list are sent to the X-10 Interface
  113. immediately.  The Event window thus always represents the
  114. current action list in the X-10 Interface.  The Event List
  115. can be printed for reference or easy review.
  116.  
  117. Events are added by selecting the following components in any
  118. sequence:
  119.  
  120.    - Unit
  121.    - Mode (Today, Tomorrow, Everyday, Weekdays, Weekends, or
  122.            Specific Days)
  123.    - Action (On, Off, or Dim)
  124.    - Time (24-hour format)
  125.    - Security (Checked or Unchecked)
  126.  
  127. The Unit and Mode are selected from drop-down lists.  The Unit
  128. list is constantly updated from the Unit window.  If a desired
  129. unit is not defined, simply switch to the Unit window, add the
  130. unit description needed, then switch back to the Event window. 
  131. Remember that both windows can be open concurrently.  I tried to
  132. make it possible to view both windows without overlap, but there
  133. is simply too much information needed for full functionality.
  134.  
  135. If Mode is Specific Days, a Day Selection control box is
  136. displayed.  Check the days you wish to have the action take
  137. place.  The box is not displayed in the other modes, since the
  138. days are implicit in the mode definition.
  139.  
  140. If Action is Dim, a Dim Level control is displayed.  Use the
  141. scroll bar to select the dim level between 0 (full bright) to 15
  142. (full dim).
  143.  
  144. To change the Time, click on the hours or minutes areas, then
  145. use the scroll bar to change the selected value.
  146.  
  147. Events can be updated by first clicking on the line describing
  148. the event, then changing controls as needed, followed by
  149. clicking on the Update button.  When an event is selected by clicking
  150. on it, all controls are updated to match the event.  This simplifies
  151. changes, since most controls will be correct.  Note that the days in the
  152. Specific Days mode appear gray to differentiate the days selected in 
  153. the interface from those being changed.
  154.  
  155. Events can be deleted by clicking on the event, followed by
  156. clicking the Delete button.  There is no undelete function.
  157.  
  158. Event files are accessed through the Event window by clicking on
  159. Files.  The current list of events can be saved to disk (default
  160. extension is .X10).  Events loaded from a disk file will
  161. completely replace the events in the interface, i.e., any events
  162. in the interface are erased when an event file is loaded.
  163.  
  164. Thanks to all the folks that provided feedback.  Without it, the bugs
  165. couldn't have been swatted as fast.  There may still be more, so be
  166. careful until you are satisfied.  I used the DOS-based software to
  167. save my event list before using this program at first, since you can
  168. easily restore any errors that way.  All you have to do is unplug the
  169. interface and remove the battery for a few seconds.  DON'T use the
  170. change base code function, since your unit descriptions get lost as
  171. well in the DOS-based version supplied with the interface.
  172.  
  173.  
  174. ERROR MESSAGES AND THEIR CAUSES
  175.  
  176. Error Opening Port
  177.   Either some other program, such as a comm program or mouse
  178.   driver, is using the port, or the X10CTL application suffered
  179.   an uncontrolled crash.  If the former, adjust the port assignments
  180.   in your computer.  If the X10CTL has crashed, you must restart
  181.   Windows, since the port was not closed, and access is cut off.  If
  182.   X10CTL crashes, record as much information concerning your actions
  183.   at that point, then e-mail a summary to me.
  184.  
  185. Error with X-10 Interface
  186.   The port has been opened and configured.  The initial attempt
  187.   to communicate with the X-10 Interface has failed.  Possible
  188.   causes include:
  189.     1.  Wrong com port selected
  190.     2.  X-10 Interface not connected
  191.     3.  X-10 Interface unplugged
  192.  
  193.   Correct the cause(s), if found, and try again.  If everything
  194.   seems normal, then it may be an unknown bug in X10CTL.  If you
  195.   can, try using a different program to access the interface to
  196.   make sure the X-10 itself is OK.
  197.  
  198.  
  199. Please forward comments, compliments, complaints, bug reports,
  200. or suggestions to
  201.  
  202.     Larry E. Fosdick  [70105,1142]
  203.  
  204.  
  205. *** Changes in Version 1.2
  206.  
  207. The ability to print the event list has been added.
  208.  
  209. A unit description of "All Lights On/Units Off" has been added to the
  210. Unit Window.  This was primarily added for those who wish to send
  211. "All Off" commands while away from home.  I have no idea who will
  212. use it to turn lights on.  Please note that the code uses DIM00 
  213. instead of ON, so that this control will only turn on lights that
  214. are connected to lamp modules or wall switches.  The off function
  215. affects all units on the selected house code.  The unit number for
  216. this function is 17, which is not real, but gives the software a hook.
  217.  
  218. I also had a request for a macro function in X10CTL.  I assume the
  219. requester is interested in saving command sequences to disk and
  220. executing them at will, as opposed to preprogrammed events or 
  221. immediate commands through a console.  There are some interesting
  222. technical problems with this, depending on the design chosen to enter
  223. and maintain macros.  If anyone is interested in this function,
  224. please let me know.  If there is sufficient interest, I may give it
  225. a try.
  226.  
  227.  
  228. *** Changes in Version 1.1
  229.  
  230. First of all, version numbers became two digits.  If I get to version
  231. 9.9 then I'll be going nuts.
  232.  
  233. The event upload has been changed again.  It should now work for any
  234. speed CPU, without adding silly delays.  If you have trouble with this
  235. version, please retest the program with a slower cpu speed, if your
  236. computer allows cpu speed switching, then report the results to me.
  237.  
  238. The intro window was added once I saw how long the screen went blank
  239. while initializing the program.  An odd quirk of Windows causes the
  240. focus to go to a window other than the Main window on my system, so
  241. I tried to incorporate a work-around using the timer.  It caused more
  242. problems than it solved, so I took it back out.  If the Main window
  243. doesn't have the focus when it first comes up, sorry.
  244.  
  245. It turns out that if you terminate a multiple window Visual BASIC
  246. program (like this one), the Form Unload subprogram is only executed
  247. on the primary window unless you unload explicitly the other
  248. windows.  This "feature" caused problems with saving changes to the
  249. Unit Decription List.  This has now been fixed.
  250.  
  251. *** Changes in Version 1.01
  252.  
  253. Three changes were made.  The first addresses an "Illegal Function
  254. Call" error when first starting the program and setting the COM port
  255. for the X-10.  This was a silly oversight.  I use the timer function
  256. to ensure that the Main window gets the focus after the intro window
  257. is removed (normally, the focus goes to some other window).  I now start
  258. the timer after the port configuration window is closed.
  259.  
  260. The second fix deals with Event updates not working properly in 1.00.
  261. It was simply a bookeeping error.
  262.  
  263. The third fix deals with uploading events from the interface.  The X-10
  264. Powerhouse does not support any form of handshaking, and so the event
  265. uploading has to be handled by a combination of timing and waiting for 
  266. the right number of characters in the buffer.  There are actually two
  267. wait periods.  I have tried to improve the robustness of the routines,
  268. and have added message boxes to help determine where the errors lie.  If
  269. you get an error message box, please record the message and let me know.
  270. CPU's faster than my 16 MHz 386SX may be too fast for my algorithm.  I am
  271. trying to avoid making it too conservative, as this slows event uploads.
  272.  
  273.  
  274.